<?php namespace Admin\Controller;
use Hdphp\Controller\Controller;
 class LoginController extends Controller{
 	
 	
	public function index(){
		$loginModel =  new \Common\Model\User;
		if(IS_POST){
		     if(!$loginModel->login()){
		     	$this->error($loginModel->getError());
		     }else{
		     	go("Index/index");
		     }
		}
		View::make();
	}
	
	//退出登录
	public function out(){
          session_unset();
		  session_destroy();
		  go("Login/index");
	}
	
 }